#define BUFF_HEADER_LEN   16
#define PACKET_HEADER_LEN 32

enum BufferType
{
    bt_None       = 0,
    bt_PlayerName = 1000,
    bt_GameUpdate
};

struct OUT_BUFFER {
    int         seqNo;
    BufferType  type;
    int         length;
    int         CRC;
    char        buffer[8000];
};

struct IN_BUFFER {
    char        header[32];
    int         seqNo;
    BufferType  type;
    int         length;
    int         CRC;
    char        buffer[8000];
};

struct MsgQElement {
    int packetID;
    int length;
};

void SetupWifi(void);
void SendGameUpdate(void);
void WaitForVBlank(void);
void FindPlayers(char *playerName);
int CalculateCRC(char *buffer, int length);
